<?php 

/**
 * Infobox!
 * 
 * In controller you can pass these parameters:
 * title - shows an title
 * message - shows an info
 * okLink - shows link [OK]
 * cancelLink - shows link [cancel]
 * redirect - will redirect automatically after default 3000ms
 * redirectTime - will change the redirection time
 * 
 * @author $Id: infobox.phtml 208 2009-07-02 11:39:47Z wisnia $
 * 
 *		//$this->view->infoBox();
		//$this->view->message = 'Huj';
		//$this->view->okLink = 'kjasdhjkasdh';
		//$this->view->cancelLink = "asdsdakjjh";
		//$this->view->redirect = 'http://localhost/';
		//$this->view->title = "pierdolony infobox";
		//$this->view->title = "pierdolony infobox";
 * 
 */

if(! isset($this->cancelLink) AND ! isset($this->okLink) AND ! isset($this->redirect))
	$this->redirect = $_SERVER['HTTP_REFERER'];

?>

<?php if(isset($this->title)): ?><h2><?php echo  $this->title ?></h2><?php endif; ?>
<?php if(isset($this->message)): ?><div style="padding-bottom: 5px;"><?php echo  $this->message ?></div><?php endif; ?>
<?php if(isset($this->cancelLink)): ?><div style="border: 2px solid #ccc; width: 150px; float: left;" align="center"><a href="<?php echo  is_string($this->cancelLink) ? $this->cancelLink : $this->url($this->cancelLink, null, true) ?>"><?php echo $this->_('Zaniechaj');?></a></div><?php endif; ?>
<?php if(isset($this->okLink)): ?><div style="border: 2px solid #ccc; width: 150px; float: right;" align="center"><a href="<?php echo  is_string($this->okLink) ? $this->okLink : $this->url($this->okLink, null, $this->userShortOkLink?false:true) ?>"><?php echo $this->_('Kontynuuj');?></a></div><?php endif; ?>
<?php if(isset($this->redirect)): ?><script>setTimeout(function() { window.location = "<?php echo  is_string($this->redirect) ? $this->redirect : $this->url($this->redirect, null, true) ?>" }, <?php echo  isset($this->redirectTime) ? $this->redirectTime : 3000; ?>)</script><?php endif; ?>
